package com.lnking.lnkingplace.mapper;

import com.lnking.lnkingplace.model.dto.isolation.worker.WorkerInfoDto;
import com.lnking.lnkingplace.model.entity.IsolationWorker;
import com.lnking.lnkingplace.model.request.isolation.worker.WorkerSearchInfoRequest;
import com.lnking.lnkingplace.model.request.isolation.worker.WorkerSearchRequest;
import com.lnking.starter.mybatis.mapper.CustomBaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhangqt
 * @since 2022-08-27
 */
public interface IsolationWorkerMapper extends CustomBaseMapper<IsolationWorker> {

    @Update(" update isolation_worker set offline = '下线' where offline ='在线' ")
    void updateOffline();

    @Select("select * from isolation_worker where offline ='在线' and phone = #{phone}")
    IsolationWorker queryDataByPhone(String phone);

    List<WorkerInfoDto> queryInfoList(WorkerSearchInfoRequest params);
}
